package com.example.company.service.impl;


import com.example.company.entity.Departments;
import com.example.company.mapper.DepartmentsMapper;
import com.example.company.service.IDepartmentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 存储部门信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-30
 */
@Service
public class DepartmentsServiceImpl implements IDepartmentsService {
	@Autowired
	private DepartmentsMapper departmentsMapper;
	
	/**
	 * 查询存储部门信息
	 *
	 * @param Departmentid 存储部门信息主键
	 * @return 存储部门信息
	 */
	@Override
	public Departments selectDepartmentsByDepartmentID(Integer Departmentid) {
		return departmentsMapper.selectDepartmentsByDepartmentID(Departmentid);
	}
	
	/**
	 * 查询存储部门信息列表
	 *
	 * @param departments 存储部门信息
	 * @return 存储部门信息
	 */
	@Override
	public List<Departments> selectDepartmentsList(Departments departments) {
		return departmentsMapper.selectDepartmentsList(departments);
	}
	
	/**
	 * 新增存储部门信息
	 *
	 * @param departments 存储部门信息
	 * @return 结果
	 */
	@Override
	public int insertDepartments(Departments departments) {
		return departmentsMapper.insertDepartments(departments);
	}
	
	/**
	 * 修改存储部门信息
	 *
	 * @param departments 存储部门信息
	 * @return 结果
	 */
	@Override
	public int updateDepartments(Departments departments) {
		return departmentsMapper.updateDepartments(departments);
	}
	
	/**
	 * 批量删除存储部门信息
	 *
	 * @param Departmentids 需要删除的存储部门信息主键
	 * @return 结果
	 */
	@Override
	public int deleteDepartmentsByDepartmentIDs(Integer[] Departmentids) {
		return departmentsMapper.deleteDepartmentsByDepartmentIDs(Departmentids);
	}
	
	/**
	 * 删除存储部门信息信息
	 *
	 * @param DepartmentID 存储部门信息主键
	 * @return 结果
	 */
	@Override
	public int deleteDepartmentsByDepartmentID(Long DepartmentID) {
		return departmentsMapper.deleteDepartmentsByDepartmentID(DepartmentID);
	}
}
